# 入口方法
from server.app import app, manager
from flask_script import Server
import server.routes

# web server
# bug调试模式，修改代码后自动重载
manager.add_command("runserver",
                    Server(host="127.0.0.1", port=app.config['SERVER_PORT'], use_debugger=True, use_reloader=True))


def main():
    manager.run()


if __name__ == '__main__':
    try:
        import sys
        sys.exit(main())
    except Exception as e:
        import traceback
